<template>
  <div id="app">
    <router-view/>
  </div>
</template>

<script>
    import AsyncJson from '@/common/js/async'

    export default {
      name: 'App',
      methods:{
        syncTime(){
          AsyncJson("get","request/requesttime").then( res => {
            if(res.status === "000"){
              let now = parseInt((Date.parse(new Date()) + "").substr(0,10));
              //console.log(res.data.datetime);
              sessionStorage.setItem("tempTime",now - res.data.datetime)
            }
          }).catch( err => {
            console.log(err);
          });
        }
      },
      created(){
        this.syncTime();
      }
    }
</script>

<style>

</style>
